
let mainResponsibilityList = [
    {
        "ironArmyType": "9999",
        "ironArmyName": "全部队伍"
    },
    {
        "ironArmyType": "1001",
        "ironArmyName": "营业员"
    },
    {
        "ironArmyType": "1002",
        "ironArmyName": "智家工程师"
    },
    {
        "ironArmyType": "1003",
        "ironArmyName": "社区经理"
    },
    {
        "ironArmyType": "1004",
        "ironArmyName": "商客经理"
    },
    {
        "ironArmyType": "1005",
        "ironArmyName": "渠道经理"
    },
    {
        "ironArmyType": "1006",
        "ironArmyName": "校园客户经理"
    },
    {
        "ironArmyType": "1007",
        "ironArmyName": "互联网团队"
    },
    {
        "ironArmyType": "1008",
        "ironArmyName": "交付专员"
    }
]

// 将"mainResponsibilityList"数组转化为哈希表
const responsibilityMap = {};
mainResponsibilityList.forEach(item => {
    responsibilityMap[item.ironArmyType] = item.ironArmyName;
});

// 给定一个ironArmyType数组，创建一个新数组
function getIronArmyNames(ironArmyTypes) {
    const result = ironArmyTypes.map(type => ({
        "ironArmyType": type,
        "ironArmyName": responsibilityMap[type] || "" // 使用哈希表查找，如果找不到则为空字符串
    }));
    return result;
}

// 给定一个ironArmyType数组
const inputIronArmyTypes = ["1001", "1003", "1007"];

// 获取对应的ironArmyName数组
const resultArray = getIronArmyNames(inputIronArmyTypes);
console.log(resultArray);
